#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include "FileMd5.h"
#include <QThread>
#include <QHash>

namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();

private:
    Ui::Widget *ui;

    FileMd5 md5;
    QThread thread;
    QHash<QByteArray,QStringList> duplicates;

private slots:
    void ongotDuplicate(const QHash<QByteArray,QStringList> &duplicates);
    void on_btn_open_clicked();
    void onProgress(int current,int total);

    void on_listWidget_md5_currentTextChanged(const QString &currentText);

signals:
    void checkDuplicate(const QString &path);
};

#endif // WIDGET_H
